package com.szbmyoubao.app.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * @author ellecity06
 * @time 2025/3/11 19:48
 * @des
 */
class MyFragmentStateAdapter : FragmentStateAdapter {
    private var list: List<Fragment>

    constructor(list: List<Fragment>, fragment: Fragment) : super(fragment) {
        this.list = list
    }

    constructor(list: List<Fragment>, activity: FragmentActivity) : super(activity) {
        this.list = list
    }

    override fun createFragment(position: Int): Fragment = list[position]

    override fun getItemCount(): Int = list.size
}